package day02;

import java.util.Scanner;

public class homework06 {
    public static void main(String[] args) {
        System.out.println("请输入一个数");
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        check_num(num);
    }

    public static void check_num(int num) {
        int ok = 0;
        for (int i = 1;i < num; i++) {
            for (int j = 1; j < num; j++) {
                if(i*j==num){
                    ok =1;
                    break;
                }
            }
        }
        if (ok==0){
            System.out.println(num+" 是质数");
        } else if (ok==1) {
            System.out.println(num+"不是质数");
        }
    }
}
